home *** CD-ROM | disk | FTP | other *** search
- #SPEC -realnameid 0
-
- # messages table
- #@@%000@@FR@@Ajouter un point \`a une courbe@@
- #@@%000@@US@@Add point to curve@@
-
- while {[.event shift] != "right"} {
-
- if { [llength [.amapi scene]] == 0 } return
-
- placepoint
- if {[.event shift] == "right"} break
-
- set mysh [.amapi current]
- newshape oldshape $mysh
- if { [oldshape -curve] == 0 } return
-
- oldshape -checkout
-
- set alledges [oldshape -edges]
- set allpoints [oldshape -points]
- set nbedges [llength $alledges]
-
- # nearest edge
- set edg [find -edge [.event mousepos] $mysh]
-
- if { $edg != "" } {
- newshape incrshape {
- for {set i 0} { $i <= [lindex $edg 0] } {incr i} {
- set curedge [lindex $alledges $i]
- set curpoint [lindex $curedge 0]
- addpoint [lindex $allpoints $curpoint]
- }
-
- incr i -1
- set nextpoint [lindex $curedge 1]
- set curcoord [lindex $allpoints $curpoint]
- set nextcoord [lindex $allpoints $nextpoint]
-
- set curcoordx [lindex $curcoord 0]
- set curcoordy [lindex $curcoord 1]
- set curcoordz [lindex $curcoord 2]
-
- set nextcoordx [lindex $nextcoord 0]
- set nextcoordy [lindex $nextcoord 1]
- set nextcoordz [lindex $nextcoord 2]
-
- set midx [expr ($curcoordx + $nextcoordx) / 2]
- set midy [expr ($curcoordy + $nextcoordy) / 2]
- set midz [expr ($curcoordz + $nextcoordz) / 2]
-
- addpoint [list $midx $midy $midz]
-
- incr i
-
- while { $i < $nbedges } {
- set curedge [lindex $alledges $i]
- set curpoint [lindex $curedge 0]
- addpoint [lindex $allpoints $curpoint]
- incr i
- }
-
- incr i -1
- set curedge [lindex $alledges $i]
- set nextpoint [lindex $curedge 1]
- addpoint [lindex $allpoints $nextpoint]
- }
-
- if {[oldshape -closed]} {
- incrshape -status close
- } else {
- incrshape -status open
- }
- incrshape -checkin
- } else {
- oldshape -checkin
- }
- }